#pragma once

namespace bai
{
	template<class Iterator,class Ref,class Ptr>
	struct Reverse_Iterator
	{
		typedef Reverse_Iterator<Iterator, Ref, Ptr> Self;
		Iterator _it;
		Reverse_Iterator(Iterator it)
			:_it(it)
		{}

		Ref operator*()
		{
			Iterator temp = _it;
			return  *(--temp);
		}

		Ptr operator->()
		{
			return &(operator*());
		}

		Self& operator++()
		{
			--_it;
			return *this;
		}


		Self& operator--()
		{
			++_it;
			return *this;
		}

		bool operator!=(const Self &s)
		{
			return _it != s._it;
		}



	};
}